<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body{font-size:12px}
</style>
<script type="text/javascript" src="__ROOT__/Public/Js/jquery-1.5.0.min.js"></script>
<script type="text/javascript" src="__ROOT__/Public/Js/core.js"></script>
<script type="text/javascript" src="__TMPL__js/jquery.dragndrop.js"></script>	
<script type="text/javascript" src="__TMPL__js/jquery.msgbox.js"></script>
<script>
   function formSubmit(){
    var title=$('#title').val();
	var content=$('#content').val();
	if(title!='' && content!=''){
     ajax.sendForm('aForm',
	    function(data){
          switch(data.result){
		    case 0:{alert('您还没有登录，请登录后再试');wClose(2);};break;
			case 1:{alert('发送成功');wClose(2);};break;
			default:{};break;
		  }		  	 	
		}
	  ); 
	  }else{
	    alert('请填写内容和标题');
	  }  
	 // document.aForm.submit(); 
   }
   
   function wClose(t){
	  if(t!='0'){
	     //t=pars
	     top.$mb.setAnimation(t)
            .setAutoClose(t);
	}else{
		  top.$mb.close();
		}
	 return false;	
   }
</script>
<title>发送留言页面</title>
</head>
<body style="width:420px;height:200px;overflow:hidden;">
  <if condition="$isLogin eq true">
  <form action="__URL__/sendMessageAjax" id="aForm" name="aForm" method="post">
<table width="419" height="112" border="0" align="center">
  <tr>
    <td width="69" align="right">用户</td>
    <td width="340"><input name="name" type="text" size="20" maxlength="20" readonly="" value="{$name}" /></td>
  </tr>
  <tr>
    <td align="right">标题</td>
    <td><label>
      <input name="title" id="title" type="text" size="20" maxlength="20" />
    </label></td>
  </tr>
  <tr>
    <td align="right">内容</td>
    <td><label>
      <textarea name="content" id="content" cols="30" rows="3"></textarea>
    </label></td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td><label>
      <input type="button" name="Submit" onclick="return formSubmit();" value="提交" />
      <input type="button" onclick="return wClose(1);"  value="取消" />
    </label></td>
  </tr>
</table>
	 </form>
	</if>
	
	<if condition="$isLogin eq false">
	  <div style="width:200px;height:200px;overflow:hidden;margin:10px auto;">您还没有登录，请登录再试</div>
	   <script>wClose(2);</script>
	</if> 
</body>
</html>
